#!/usr/bin/env python

import sys
import pandas as pd
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt

tsv_path = sys.argv[1]

df = pd.read_csv(tsv_path, parse_dates=True)
df['time'] = pd.to_datetime(df['time'])
df = df.set_index('time')

plt.figure(figsize=(40, 20))

groups = df.groupby('product')
#fig, ax = plt.subplots(figsize=(100, 50))

for name, group in groups:
  # if not name.startswith('BCH'):
  plt.plot(group['kimchi'], marker=None, label=name)
plt.legend(loc='upper right')

plt.savefig('output.png')
